﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FaultBackService.Models;
using FaultBackService.Shared;

namespace FaultBackService.BLL
{
    class TrendStableValue
    {
        DAL.TrendStableValue dal = new DAL.TrendStableValue();
        /// <summary>
        /// 获取趋势分析最新的日期
        /// </summary>
        /// <returns></returns>
        internal DateTime GetLastTimeStamp()
        {
            var model= dal.GetLastOne();
            if (model!=null)
            {
                return model.TimeStamp;
            }
            else
            {
                return Global.DefaultTime;
            }
        }

        /// <summary>
        /// 向TrendStableValue中写入多条数据
        /// </summary>
        /// <param name="list"></param>
        internal int AddRange(IList<Models.TrendStableValue> list)
        {
            return dal.AddRange(list);
        }
    }
}
